<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title>[%$ESPCMS_SOFT_TITLE%]</title>
		<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
		<link href="[%$ESPCMS_ADMIN_TEMPLATES_URL%]css/espcms_style_font_icon.css" rel="stylesheet" type="text/css" />
		<link href="[%$ESPCMS_ADMIN_TEMPLATES_URL%]css/espcms_style_public.css" rel="stylesheet" type="text/css" />
		<link href="[%$ESPCMS_ADMIN_TEMPLATES_URL%]css/espcms_all.css" rel="stylesheet" type="text/css" />
		<link href="[%$ESPCMS_ADMIN_TEMPLATES_URL%]css/espcms_framework.css" rel="stylesheet" type="text/css" />
		<link href="[%$ESPCMS_ADMIN_TEMPLATES_URL%]css/espcms_select.css" rel="stylesheet" type="text/css" />
		<link href="[%$ESPCMS_ADMIN_TEMPLATES_URL%]css/pageload.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/jquery.min.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/jquery-ui.min.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/jquery.cookie.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_dialog.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/md5.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/json.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/bootstrap.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/lngpack_cn.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_form.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_formvalidation.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_dialog.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_function.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_tool.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_page.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_select.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_checkbox.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_select_checkbox.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_batch.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_tab.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_multiple.js"></script>
		<script type="text/javascript">
			$(document).ready(function () {
				banpageKey();
				$('#espcms_saveInfo').ajaxForm({
					type: 'POST',
					url: '[%$link.execute%]',
					dataType: 'json',
					success: function (data) {
						if (data.length > 0) {
							var valuemin = 100 / data.length;
							valuemin = valuemin.toFixed(2);
							update_execute(data, 0, data.length, valuemin);
							$('#submit_div').hide();
							$('#load_div').show();
							$('#submit').attr('disabled', 'disabled');
							$('#espcms_save_cancel').attr('disabled', 'disabled');
						}
					}
				});
				function update_execute(softdata, limit_num, pack_num, valuemin) {
					if (limit_num >= pack_num) {
						parent.locationout();
						return false;
					}
					$('#return_num').empty().append(softdata[limit_num]['volstr']);
					$.ajax({
						type: "post", url: "[%$link.view%]",
						dataType: 'json',
						data: {uid: softdata[limit_num]['uid']}, global: false,
						success: function (data) {
							limit_num = limit_num + 1;
							var valuenow = Math.round(valuemin * limit_num);
							$('#progress_bar').attr('aria-valuenow', valuenow);
							$('#progress_bar').css('width', valuenow + '%');
							$('#progress_bar').empty().append(valuenow + '%');
							if (data.isreset) {
								parent.locationout();
								return true;
							}
							update_execute(softdata, limit_num, pack_num, valuemin);
						}
					});
				}
				$('.espcms_save_cancel').click(function () {
					parent.closeifram();
				});
			});
		</script>
	</head>
	<body class="dialog_body">
		<form class="form-horizontal admin-form" id="espcms_saveInfo" action="[%$link.execute%]">
			<input type="hidden" name="token_key" id="token_key" value="[%$token.token_key%]"/>
			<input type="hidden" name="token_name" id="token_name" value="[%$token.token_name%]"/>
			<div class="panel-body" id="submit_div">
				[%if $update.volstr%]
				<div class="section-divider mb30"><span>[%pack:setting_pack-espcms_update_title%]</span></div>
				<table class="espcms_view_table">
					<tr>
						<td class="title_at1 col-sm-2">[%pack:setting_pack-espcms_update_now_vol%]</td>
						<td class="col-sm-10">[%$vol%]</td>
					</tr>
					<tr>
						<td class="title_at1 col-sm-2">[%pack:setting_pack-espcms_update_new_vol%]</td>
						<td class="col-sm-10">[%$update.volstr%]</td>
					</tr>
					<tr>
						<td class="title_at2 col-sm-2">[%pack:setting_pack-espcms_update_vol_content%]</td>
						<td class="col-sm-10">
							<div class="scro_div" style="width:100%;max-height:200px;overflow: auto;font-size:12px;line-height: 180%;">
								[%$update.content%]
							</div>
						</td>
					</tr>
				</table>
				[%else%]
				<div class="col-sm-12 text-center pt20 f20 text-orange">[%pack:setting_pack-espcms_update_new_vol_message%]</div>
				[%/if%]
			</div>
			<div class="panel-body displaynone" style="padding-top:100px;" id="load_div">
				<div class="col-md-12 center mb10 mt15 f24" id="loading">[%pack:setting_pack-espcms_update_loading_title%]</div>
				<div class="col-md-12 center mb10 mt15"><span id="return_num"></span>[%pack:setting_pack-espcms_update_loading_title2%]</div>
				<div class="progress" id="progress">
					<div class="progress-bar progress-bar-danger" id="progress_bar"  role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 0%"></div>
				</div>
			</div>
			<div class="dialogbotton">
				<div class="dialog_buttonset">
					[%if $update.volstr%]
					<button type="submit" id="submit" class="btn btn-green min-w-150" formmethod="POST">[%pack:botton_pack-espcms_botton_update_ok%]</button>
					[%/if%]
					<button type="button" id="espcms_save_cancel" class="btn btn-lightgray min-w-150 espcms_save_cancel">[%pack:botton_pack-espcms_botton_close_dialog%]</button>
				</div>
			</div>
		</form>
	</body>
</html>
